<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./echarts/echarts.min.js"></script>
</head>

<body>
  <div id="main" style="width: 500;height:900px;"></div>
  <script>
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.querySelector('#main'));

    // 指定图表的配置项和数据
    const option = {
      title: {
        text: '班级薪资分布',
        top: '20',
        left: '20',
        textStyle: {
          fontSize: 30,
        }
      },
      legend: {
        bottom: '40',
        left: 'center',
        // 图例图标宽度
        itemWidth: 50,
        itemHeight: 26,
        // 文本样式
        textStyle: {
          fontSize: 23
        },
        // 图例之间的间隔
        itemGap: 29,
      },
      series: [
        {
          name: 'Access From',
          type: 'pie',
          // 饼图内外直径
          radius: ['40%', '50%'],
          avoidLabelOverlap: false,
          itemStyle: {
            // 饼图圆角
            borderRadius: 20,
            borderColor: '#fff',
            borderWidth: 2
          },
          label: {
            show: false,
            position: 'center'
          },
          emphasis: {
            label: {
              show: true,
              fontSize: 40,
              fontWeight: 'bold'
            }
          },
          labelLine: {
            show: false
          },
          data: [
            { value: 230, name: '1万以下' },
            { value: 910, name: '1-1.5万' },
            { value: 600, name: '11.5-2万' },
            { value: 800, name: '2万以上' },
          ]
        }
      ],
      color: ['#fda224', '#5097ff', '#3abcfa', '#34d39a']
    };

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
  </script>
</body>

</html>